package com.example.bbook.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.HashMap;

@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("u_addr")
public class AddrEntity extends  BaseEntity {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Integer userId;
    private String addr;
    private String phone;
    private String title;

    public AddrEntity() {
        this.setColumns(new ArrayList<>());
        push("id", "number", "ID", new int[]{0, 1, 1, 0})
        .push("userId", "number", "用户ID", new int[]{0, 1, 1, 0})
        .push("addr", "string", "用户地址", new int[]{1, 1, 1, 1})
        .push("phone", "string", "用户通信方式", new int[]{1, 1, 1, 1})
        .push("title", "string", "地址标题", new int[]{1, 1, 1, 1});

    }

    public ArrayList<HashMap<String, Object>> thisColumns() {
        return getColumns();
    }
}
